package com.hp.common.annotation;

import com.hp.common.validator.PhoneValidatorClass;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.PARAMETER, ElementType.FIELD})
@Constraint(validatedBy = PhoneValidatorClass.class)
public @interface PhoneValidator {
    //是否必填
    boolean required() default true;

    //提示内容
    String message() default "手机号不合法";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
